package cn.hdu.liang.io;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.nio.channels.FileChannel;

public class TransferTo {
    public static void main(String[] args) throws Exception {
        FileChannel in = new FileInputStream(PATH.FILE_PATH + "TransferTo.java").getChannel();
        FileChannel out = new FileOutputStream(PATH.OUT + "transferTo.txt").getChannel();
        in.transferTo(0, in.size(), out);
        out.transferFrom(in, 0, in.size());
    }
}
